﻿// ע�

using IotContract.Interfaces.File;
using System.IO;

namespace IotClientService.File;
/// <summary>
/// 文件操作
/// </summary>
public  class FileService : IFileService
{
    /// <summary>
    /// 字符串写入文件
    /// </summary>
    /// <param name="path">文件路径</param>
    /// <param name="filname">文件名</param>
    /// <param name="content">写入内容</param>
    public  void WriteToFile(string path, string filname, string content) 
    {
        if (!Directory.Exists(path))
        {
            Directory.CreateDirectory(path);
        }
        var filePath = path + "/" + filname;

        System.IO.File.WriteAllText(filePath, content);
    }
}
